<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script src="/xlive/script/xlv.js"></script>
</head>
<body>
	<div id="newPost_main" xlvobject="xlv.obj.pane" xlvprop="{glow:{enable:true},border:{enable:true}}"
		xlvmethod="{
			styleFor:function(root){
				root.style.background='url(/xlive/images/lightgrayTexture.gif) left top repeat';
			}
		}"
	>
	  <div xlvobject="xlv.obj.webObject" xlvprop="{name:'fs.forum',objectURL:'fs.forum'}">
	  </div>	
	  	<div style="padding:10px;width:600px;">
			<table style="border-collapse:collapse;font-family: Arial;font-size: 12px;text-align:left;">
				<tr>
					<td align="center">
						<div xlvobject="xlv.obj.img" xlvprop="{dmName:'forum.post',dmPath:'properties.new-post.post-icon',width:32}">
						</div>
					</td>
					<td style="width:100%"><span style="font-size:20px;font-style:italic;">Create a new post</span></td>
					<td><nobr>
						<span xlvobject="xlv.obj.process" 
							 xlvprop="{title:'Save',srcImg:'/xlive/images/save.png'}"
							 xlvmethod="{
							 	process:function(options){
							 		this.getDesktop().systemModal(true);
							 		this.getObjectById('uploader').process();
							 	}
							 }"
							>
						</span>
						<span id="after_insert" xlvobject="xlv.obj.dmTrigger"
							 xlvprop="{dmName:'forum.post',listener:{when:'afterModelChanged',notify:'setChanged',memoType:'create',memoMethods:'new-post'}}"
							 xlvmethod="{
							 		process:function(options){
							 			var dm=this.getDataModel('forum.topic');
										dm.webMethod('topic');
							 			this.getDesktop().systemModal(false);
							 			this.getPaneById('newPost_main').dispose();
									}
							 }"
						>
						</span>
						<span xlvobject="xlv.obj.process" 
							 xlvprop="{title:'Cancel',srcImg:'/xlive/images/cancel.png'}"
							 xlvmethod="{
							 	process:function(options){
							 		this.getPaneById('newPost_main').dispose();
							 	}
							 }"
							>
						</span>
						</nobr>
					</td>
				</tr>
				<tr>
					<td><nobr><img src="/xlive/images/forum/page_edit.png"/><span style="white-space:nowrap;padding:8px">Subject : </span></nobr></td>
					<td colSpan="2"><div style="width:100%" xlvobject="xlv.obj.input" xlvprop="{dmName:'forum.post',dmPath:'properties.new-post.post-title'}"></div></td>
				</tr>
				<tr><td><nobr><img src="/xlive/images/forum/attach.png"/><span style="white-space:nowrap;padding:8px">Attach : </span></nobr></td>
					<td>
						<div id="uploader"  style="padding:4px"
							 xlvobject="xlv.obj.uploader"
				    	 	 xlvprop="{
				    	 		showSubmit:false,
				     			dmName:'fs.forum',methodName:'properties.upload',
				     			srcImg:'/xlive/images/_upload.png'
				     			}"
				     		 xlvmethod="{
				     		 	process:function(){
				     		 		this.$V.workdir=new Date().getTime();
				     		 		this.getDataModel('fs.forum').setValue(this.$V.workdir,'properties.upload.work-directory');
				     		 		this.$self('process');
				     		 	},
				     		 	uploadResposed:function(valid,why){
				     		 		var dm=this.getDataModel('forum.post');
				     		 		dm.setValue(this.$V.workdir,'properties.new-post.post-workdir');
				     		 		var dmfs=this.getDataModel('fs.forum');
				     		 		var files=dmfs.xml_selectNodes('properties/upload/return/data/file');
				     		 		var attach='';
				     		 		for(var i=0;i &lt; files.length;++i){
				     		 			attach+=xlv.util.getElementValue(files[i])+'( '+files[i].getAttribute('length')+' bytes);';
				     		 		}
				     		 		dm.setValue(attach,'properties.new-post.post-attach');
							 		var t2=this.getObjectById('post_text_editor');
							 		t2.commit();
							 		dm.setValue('1','properties.list.row-from');
							 		dm.webMethod('new-post');
								}
				     		 }"		
						 >
						</div>
					</td>			
				</tr>
				<tr>
					<td colSpan="3">
					<div id="post_text_editor" xlvobject="xlv.obj.richEditor" xlvprop="{dmName:'forum.post',dmPath:'properties.new-post.post-text'}"></div></td>
				</tr>
			</table>
			<div>
				<span style="color:gray;font-size:10px">create a new post, write subject and description, press save to post </span>
			</div>
	   </div>	
	  
	</div>
</body>
</html>
